package Recurtion;

public class RecurtionClass {

    // 求最小值
    public static int re_min(int[] a,int i){
        if(i==0){
            return a[i];
        }
        else{
            int min = re_min(a,i-1);
            if(min>a[i]) return a[i];
            else return min;
        }
    }
    // 求最大值
    public static int re_max(int[] a,int i){
        if(i==0){
            return a[i];
        }
        else{
            int max = re_max(a,i-1);
            if(max<a[i]) return a[i];
            else return max;
        }
    }

}
